Context-aware image filtering

ABSTRACT

In some embodiments, an image processing application executing on a processing device detects an object in an image that is in a field of view of a camera associated with the processing device. The image processing application further determines, based on the object detected in the image, a recommended filter for the image from a list of filters available for filtering the image. The image processing application causes a display device to display a user interface that includes a contextual user interface control. The contextual user interface control indicates that a context-aware image filtering mode is available for the image. Responsive to receiving a selection of the contextual user interface control, the image processing application enables the context-aware image filtering mode by automatically applying the recommended filter to the image to generate a filtered image and causes the display device to display the filtered image.

TECHNICAL FIELD

This disclosure relates generally to computer-implemented methods andsystems for computer graphics processing. Specifically, the presentdisclosure involves automatically filtering an image based on thecontent of the image.

BACKGROUND

Mobile cameras, such as the cameras embedded in a smartphone or atablet, allow a user to take photos anywhere and anytime. For novicephotographers, however, knowing which filters or effects to apply whenphotographing can be overwhelming. Existing mobile camera apps typicallypresent to the user a list of filters. Effects that can be created bythese filters are buried in the detailed settings. Photographers who areunfamiliar with the filters and various settings would have to try outthe filters and settings one by one, which is a time-consuming process.Even after trying different filters or settings, the photographers mightstill be unsure about which filter provides the desired look for theirphotos, leading to unsatisfactory results in the captured photos.

These and other disadvantages exist with respect to conventional imagefiltering systems.

SUMMARY

Certain embodiments involve context-aware image filtering for mobilecameras. In one example, an image processing application executing on aprocessing device detects an object in an image that is in a field ofview of a camera associated with the processing device. The imageprocessing application further determines, based on the object detectedin the image, a recommended filter for the image from a list of filtersavailable for filtering the image. The image processing applicationcauses a display device to display a user interface that includes acontextual user interface control. The contextual user interface controlindicates that a context-aware image filtering mode is available for theimage. Responsive to receiving a selection of the contextual userinterface control, the image processing application enables thecontext-aware image filtering mode by automatically applying therecommended filter to the image to generate a filtered image and causesthe display device to display the filtered image.

These illustrative embodiments are mentioned not to limit or define thedisclosure, but to provide examples to aid understanding thereof.Additional embodiments are discussed in the Detailed Description, andfurther description is provided there.

BRIEF DESCRIPTION OF THE DRAWINGS

Features, embodiments, and advantages of the present disclosure arebetter understood when the following Detailed Description is read withreference to the accompanying drawings.

FIG. 1 depicts an example of a computing environment for providingcontext-aware image filtering according to certain embodiments of thepresent disclosure.

FIG. 2 depicts an example of a process for determining a recommendedfilter and automatically applying the recommended filter to a livepreview image to generate a filtered image, according to certainembodiments of the present disclosure.

FIG. 3 depicts an example of a block diagram of an image processingdevice configured to perform the context-aware image filtering,according to certain embodiments of the present disclosure.

FIGS. 4A and 4B depict an example of a process for utilizingcontext-aware image filtering to process live images from a camera of amobile device, according to certain embodiments of the presentdisclosure.

FIG. 5 depicts an example of a user interface for context-aware imagefiltering, according to certain embodiments of the present disclosure.

FIG. 6 depicts another example of a user interface for context-awareimage filtering, according to certain embodiments of the presentdisclosure.

FIG. 7 depicts yet another example of a user interface for context-awareimage filtering, according to certain embodiments of the presentdisclosure.

FIG. 8 depicts yet another example of a user interface for context-awareimage filtering, according to certain embodiments of the presentdisclosure.

FIG. 9 depicts an example of a user interface for adjusting theparameters of the selected filter, according to certain embodiments ofthe present disclosure.

FIG. 10 depicts an example of a computing system that can be utilized toperform certain embodiments of the present disclosure.

DETAILED DESCRIPTION

The present disclosure involves context-aware image filtering for mobilecameras. As discussed above, existing mobile camera apps provide littleor no assistance to users of cameras to choose proper filters for theirpictures leading to unsatisfactory results in the captured pictures.Certain embodiments described herein address these limitations byanalyzing the images from a camera in real time or near real time andproviding recommendations on filters to be used on the images. Forinstance, an image processing application accesses an image that is inthe field of view of the camera and detects an object in the image.Based on the detected object, the image processing applicationdetermines, from a list of available filters, a recommended filter thatis designed to filter or suitable for filtering the detected object orimages containing the detected object. The image processing applicationgenerates and presents a user interface to indicate that an object isdetected in the image and a context-aware image filtering mode isavailable. If the image processing application receives user inputconfirming that the context-aware image filtering mode should beenabled, the image processing application automatically applies therecommended filter to the image to generate a filtered image fordisplay. The image processing application provides a user with an optionto save the filtered image or adjust the filtering by using anothersetting of the recommended filter or using another filter.

The following non-limiting example is provided to introduce certainembodiments. In this example, an image processing application receivesan image from a camera. The image depicts the visual perception of thescene that is currently in the field of the view of the camera and, ifthe camera moves, is updated to depict a modified scene within thecamera's field of view. Such an image is also referred to herein as a“live preview image” because the image allows a user to preview thecontent of an image before saving the image to a memory device. Theimage processing application detects an object in the image, forexample, a face, an animal, a house, a tree, a dish, a mountain, and soon. Based on the detected object, the image processing applicationselects, from a list of available filters, one or more filters that areapplicable to the detected object. For example, if a face is detected inthe image, the image processing application identifies one or morefilters that are applicable to filtering a face object, such as a filterdesigned to smooth skin tone or a filter for turning a color image to agrey image.

From the applicable filters, the image processing application determinesa recommended filter to be applied to the image. The determination canbe made based on, for example, the type of the object, the preference orpast behavior of the user, the geographical location where the image istaken, the date or time when the image is taken, or other factors. Inthe above example, the image processing application determines that thefilter designed to smooth the skin tone is more suitable for the faceobject detected in the image and thus determine this filter as arecommended filter.

The image processing application further generates and presents a userinterface indicating that a context-aware image filtering mode isavailable. The indication can be provided by presenting a contextualuser interface control in the user interface. If the user selects thecontextual user interface control, the image processing applicationenters the context-aware image filtering mode and automatically appliesthe recommended filter to the image to generate a filtered image fordisplay. The image processing application continues to access updatedimages from the camera and apply the recommended filter to the updatedimage until a user input is received. Depending on the user input, theimage processing application can save the filtered image or discard theresult and restart the above process for a new image received from thecamera. In some examples, the image processing application furtherpresents the list of applicable filters along with the recommendedfilter in the user interface so that the user can select a differentfilter to generate the filtered imaged.

As described herein, certain embodiments provide improvements in imageprocessing by providing context-aware image filtering. These embodimentsprovide context-aware image filtering by, for example, automaticallyanalyzing the image captured by a camera in real time and generating afiltered image using a recommended filter based on the analysis of theimage. The context-aware image filtering improves the quality of thefiltered image by determining the recommended filter based on thecontent of the image thereby reducing the impact on the quality of thefiltered image by the uncertainty in filter selection caused by theinexperienced user. This also ensures consistency in the quality of thecaptured images using the camera. Further, the context-aware imagefiltering significantly reduces the time and efforts a user spends onadjusting the image to achieve the desired result, thereby improving theuser experience with the camera.

Example Operating Environment for Context-Aware Image Filtering

Referring now to the drawings, FIG. 1 depicts an example of a computingenvironment 100 for providing context-aware image filtering. Thecomputing environment 100 includes a computing device 102, whichincludes one or more processing devices 132 that execute an imageprocessing application 108. The image processing application 108includes program code to perform one or more functions for context-awareimage filtering that generate filtered image 116. Examples of thecomputing device 102 include a smartphone, a tablet, a digital camera,or any other types of mobile device that includes at least a camera, adisplay and a processing device capable of filtering images captured bythe camera.

The computing device 102 further includes a camera 104. The camera 104is an optical instrument for recording or capturing an image 106 of thereal-world scene that is in the field of view of the camera 104. Thecomputing device 102 further includes a display device 110 configured topresent information in a visual form. For example, the display device110 might be configured to display graphical user interface (“GUI”)elements, text, images, video, or other data.

In one example, the camera 104 is coupled with the display device 110 toprovide a live preview feature. The live preview feature allows livepreview images of the camera 104 to be displayed on the display device110 so that a user 126 of the computing device 102 can view the imagebefore saving it to a storage device 114. This allows the display device110 to be used as a viewfinder of the camera 104. In addition to thelive preview images, the display device 110 is further utilized todisplay a user interface 112 generated by the image processingapplication 108. The user interface 112 receives commands or other inputfrom a user that cause the image processing application 108 tomanipulate the live preview images displayed thereon or adjusting cameraparameters. The image processing application 108 generates and presentsthe user interface 112 to allow the user 126 to view the live previewimage 106 and the filtered image 116 generated by the context-awareimage filtering in real time or near real time, and to allow the user126, through user input 124, to make various selections regarding thelive preview image 106 and the filtered image 116 including saving thefiltered image 116 to the storage device 114.

According to embodiments presented herein, the image processingapplication 108 accesses the live preview images from the camera 104 toperform the context-aware image filtering. In one example, the imageprocessing application 108 obtains a live preview image 106, alsoreferred to as “image 106,” from the camera 104. The image processingapplication 108 analyzes the live preview image 106 to determine thesubject of the image 106. For example, the image processing application108 can analyze the live preview image 106 to detect an object, a scene,color or any combination thereof in the image. Based on the analysis,image 106 can be classified into one or more of categories of images.The categories of images include, but are not limited to, a human facecategory, a natural scene category, a sky category, a food category, anight-time category, and so on. Additional examples of analyzing thelive preview image 106 and determining the category of the image areprovided below with regard to FIGS. 2-4.

Based on the determined image category, the image processing application108 identifies a list of filters that are applicable to the live previewimage 106. The image processing application 108 selects the list ofapplicable filters from a set of available filters 122. The availablefilters 122 can be stored, in the storage device 114 associated with thecomputing device 102, as a filter library and can be invoked by theimage processing application 108 if needed. The set of available filters122 include all the filters that can be invoked by the image processingapplication 108 to apply to an image regardless of the effects. However,some of the available filters 122 are not suitable for a certaincategory of images. For example, a filter designed for smoothing theskin tone of a face is not suitable for an image depicting a naturalscene. Similarly, a filter designed for brightening the sky might not besuitable for an image of food. Some filters, on the other hand, areapplicable to any category of images. For example, a filter for turninga color image into a black-and-white image can be applied to any colorimage. A 3D filter configured for inserting a 3D object into an inputimage to generate a combined image can also be applied to any image.

Based on the properties of the available filters 122 and the category ofthe live preview image 106, the image processing application 108 selectsa list of filters that are applicable to the image 106. In the aboveexamples, if the live preview image 106 is determined to be an image ofhuman face, the filter for smoothing the skin tone, the 3D filter, andthe filter for converting color images into black-and-white images maybe included in the list of filters that are applicable to the image 106,whereas the filter for brightening the sky will not be included in thelist of applicable filters.

Among the list of applicable filters, the image processing application108 further selects a recommended filter that can be applied to the livepreview image 106. The recommended filter can be determined by matchingthe property of the filter with the content of the live preview image106, such as by matching a filter designed to filter a face to an selfieimage, matching a filter designed for brightening the sky to an outdoorimage with a large portion depicting the sky, and so on. Selecting therecommended filter can further be based on a user profile 120established for a user 126 of the computing device 102. The user profile120 can include the preference or past behavior of the user 126, such asthe filters selected by the user 126 in the past for each category ofimages, the user's preference on the color, brightness, and contrast ofimages in each category. The user profile 120 can be built based on theuser's explicit input or by analyzing the saved images 118, such as aphoto gallery, on the storage device of the computing device 102.Furthermore, the user profile 120 can be built based on data related tothe user 126 that are stored on various remote servers 130 accessibleover a network 128, such as the user's social media account, the user'sonline photo album, and so on. In some implementations, the imageprocessing application 108 can access these online data related to theuser by integrating, with the user's permission, with the apps that areinstalled on the computing device 102 for accessing the online data. Inone example, the user profile 120 is also stored in the storage device114.

In further examples, the recommended filter can be selected based oncontextual information, such as the geographical location of thecomputing device 102 indicating where the image is captured, the datewhen the image is captured, the time of the image being captured, orevents associated with the image. The contextual information is usefulto select a recommended filter that is relevant to the location, date,time or event associated with the image. For example, a filter designedfor adding virtual green and red 3D holiday decorations to an image canbe recommended if the date of the image being captured is close toChristmas day. Similarly, a filter designed to add a text such as“Welcome to the Golden Gate Bridge” can be recommended if the imageprocessing application 108 determines that the current location of thecomputing device 102 is near Golden Gate Bridge and the content of theimage 106 has a bridge object. The image processing application 108 canobtain these contextual data from other components of the computingdevice 102 (not shown in FIG. 1), such as a GPS component, an internalclock and so on. Additional examples of determining the recommendedfiler are provided with regard to FIGS. 2-4.

In various embodiments, the above process for analyzing the live previewimage 106 and determining the list of applicable filters and therecommended filter are automatically performed without user'sintervention. For instance, the above process could commence in responseto some trigger other than a user input causing the camera to captureand store an image. Examples of these triggers include a live previewimage 106 being displayed within the camera's field of view for athreshold amount of time, a threshold amount of change in the scenedisplayed within the camera's field of view, etc. The image processingapplication 108 accesses the live preview image 106 from time to time sothat the live preview image 106 reflects the real-world scene that iscurrently in the field of view of the camera 104. For each live previewimage 106, the image processing application 108 automatically performsthe process described above to analyze the image and determine therecommended filter and list of the applicable filters.

As the image processing application 108 analyzes the live preview image106, if the subject of the live preview image 106 is determined, such asby detecting an object in the live preview image 106, the imageprocessing application 108 generates and presents a contextual userinterface control 134 in the user interface 112 to indicate thatcontext-aware image filtering is available. The user 126 can view theresults of the context-aware image filtering by selecting the contextualuser interface control 134, such as by touching or selecting thecontextual user interface control using his finger or a stylus, orotherwise activating it, e.g. using a voice command.

If the image processing application 108 determines that the user 126 hasselected the contextual user interface control 134, the image processingapplication 108 enters a context-aware image filtering mode. The mode ofthe image processing application 108 before the user selects thecontextual user interface control 134 is referred to aspre-context-aware image filtering mode. In the context-aware imagefiltering mode, the image processing application 108 automaticallyapplies the recommended filter to the live preview image 106 to generatethe filtered image 116 and present the filtered image 116 in the userinterface 112. The image processing application 108 also presents thelist of applicable filters in the user interface 112. The user 126 mayselect another filter from the list of applicable filters to apply tothe live preview image 106 to generate the filtered image 116. In afurther implementation, the image processing application 108 providesfurther user interface controls to allow the user 126 to adjust theparameters of the filter being applied. The image processing application108 updates the filtered image 116 based on the parameter specified bythe user 126 and display the filtered image 116 in real time or nearreal time in the user interface 112. If the user requests the filteredimage 116 to be saved, the image processing application 108 saves thecurrent filtered image 116 to the storage device 114 or other locationspecified by the user 126. Additional details on the user interface 112are provided below with regard to FIGS. 5-9. Additional detailsregarding the context-aware image filtering are described herein withrespect to FIGS. 2-10.

Examples of Computer-Implemented Operations for Context-Aware ImageFiltering

FIG. 2 depicts an example of a process 200 for determining a recommendedfilter and applying the recommended filter to the live preview image togenerate a filtered image, according to certain embodiments of thepresent disclosure. In some embodiments, operations depicted in FIG. 2and described herein are used to implement a step for determining arecommended filter and applying the recommended filter to the livepreview image to generate a filtered image. FIG. 2 is described inconjunction with FIG. 3 where an example of a block diagram of thesoftware modules used for context-aware image filtering is depicted. Acomputing device (e.g., the computing device 102) implements operationsdepicted in FIG. 2 by executing suitable program code (e.g., the imageprocessing application 108). For illustrative purposes, the process 200is described with reference to certain examples depicted in the figures.Other implementations, however, are possible.

At block 202, the process 200 involves obtaining a live preview image106 from a camera 104 of the computing device 102. For instance, thecamera 104 continuously and directly projects the image formed by thelens of the camera 104 onto the image sensor to generate the livepreview image 106. The image processing application 108 obtains the livepreview image 106 by accessing the memory that stores the live previewimage 106 or through other means.

At block 204, the image processing application 108 enters thepre-context-aware image filtering mode, and the process 200 involvesautomatically detecting an object 314 in the live preview image 106. Asshown in FIG. 3, in one example, the image processing application 108employs an object detection module 302 to detect the object 314 in thelive preview image 106. For example, the object detection module 302employs a face detection algorithm to the live preview image 106 todetermine whether a face object exists in the live preview image 106.Appearance-based face detection methods, such as those based on geneticalgorithm, eigen-face techniques or a machine learning model trained torecognize human faces from images can be utilized to detect human facesin the live preview image 106. Other techniques that are known in theart for detecting a human face from an image can also be utilized, suchas feature-based, knowledge-based, or template matching methods.Similarly, other types of object detection algorithms can be applied tothe live preview image 106 to detect objects 314, such as car object,human object, building objects, a food object, a tree, a mountain and soon.

In some implementations, to reduce the computational complexity of thecontext-aware image filtering and to conserve power of a battery-poweredcomputing device 102, one or more operations of the object detectionmodule 302 are performed on a down-sampled version of the live previewimage 106. In one example, the live preview image 106 is down-sampled toa maximum of 480 pixels in height, and the resolution of thedown-sampled image is determined based on the aspect ratio that the userhas selected for the live preview image 106 in the camera settings. Inother words, the live preview image 106 is down-sampled to generate atest image by keeping the aspect ratio of the live preview image 106.The generated test image has a maximum height of 480 pixels and thewidth of the test image is determined based on the aspect ratio of thelive preview image 106. Because the test image is smaller than the livepreview image 106, the object detection module 302 can perform theobject detection using fewer computations.

Similarly, the object detection module 302 can further reduce thecomputational complexity of object detection by limiting the detectionoperation to certain live preview images or down-sampled test images. Inone example, the object detection module 302 detects the object in thelive preview image 106 or the down-sampled test image of the livepreview image 106 for every N images, such as N=10 images, captured bythe camera 104, instead of every image. The Nth detection of a livepreview image 106 or the down-sampled test image can be a trigger thatcauses the image processing application 108 to automatically performcertain operations of process 200.

Certain embodiments that involve this reduction in computationalcomplexity can facilitate object detection for the context-aware imagefiltering to determine the presence of the object. For instance, thereduced spatial resolution and temporal resolution of the live previewimages 106 can provide enough information to perform object detectionwithout imposing a high computational burden on the computing device102. In addition, object tracking (i.e. tracking the detected object inpositional space from one live preview image 106 to another) is notperformed in this pre-context-aware image filtering mode to reduce thecomputation power of the computing device 102.

In some scenarios, more than one object might be detected in the livepreview image 106. For example, a face object in the foreground andscenery in the background are both detected in the live preview image106. To determine the dominant object in the live preview image 106, theimage processing application 108 employs a tie-breaking mechanism. Inone example, the image processing application 108 examines thepercentage of the space that each object occupies in the live previewimage 106. For each type of object, a threshold amount of space can bespecified. If the detected object occupies a percentage amount of spacemore than the corresponding threshold amount of space, the object isselected as the detected object.

In the above example, for a face image, if the largest detected faceobject is more than 15% of space in the live preview image 106, theimage processing application 108 determines that a face object isdetected. Otherwise, the image processing application 108 determinesthat scenery is detected in the live preview image 106.

Referring back to FIG. 2, at block 206, the process 200 involvesdetermining a recommended filter for the live preview image 106 based onthe detected object. One or more computing devices execute program codefrom the image processing application 108 to implement block 204. Forinstance, the image processing application 108 applies a filterrecommendation module 304 as shown in FIG. 3 to determine therecommended filter 316. In some implementations, the filterrecommendation module 304 maintains or accesses a list of filters thatare available for filtering an image. The list of available filters caninclude the filters that are available locally on the computing device102, such as stored locally in a library on the storage device 114, orremotely from an online filtering service, for example.

Based on the available filters, the filter recommendation module 304determines a list of filters that are applicable to the live previewimage 106. In one example, whether a filter is applicable to the livepreview image 106 is determined based on whether the filter is designedto filter the type or category of the live preview image 106. The filterrecommendation module 304 determines a type or a category of the livepreview image 106 based on the detected object 314. For instance, if thedetected object 314 is a human face, the filter recommendation module304 can determine that the live preview image 106 is in the category offace images, and filters that are designed to smooth the skin tone wouldbe included in the list of applicable filters for the live preview image106. If the detected object 314 is a building, the filter recommendationmodule 304 can determine that the live preview image 106 is in thecategory of outdoor scene images, and filters for filtering outdoorscene can be included in the list of applicable filters. If the detectedobject 314 is a food object, the filter recommendation module 304 candetermine that the live preview image 106 is in the category of foodimages, and filters for filtering food can be included in the list ofapplicable filters. The applicable filters can also include filters thatare applicable to images regardless of the categories of the image, suchas a filter converting a color image to a black-and-white image, or afilter creating a painting effect from an image.

From the list of applicable filters, the filter recommendation module304 selects a recommended filter 316 for the live preview image 106. Insome implementations, the filter designed to filter images in thecategory of the live preview image 106 is selected as the recommendedfilter, such as a skin tone smoothing filter is recommended for a selfieimage, a food filter is recommended for a food image. In addition, therecommended filter can be selected based on a number of other factors.In one example, the filter recommendation module 304 can select therecommended filter based on the past behavior of the user in selecting afilter for an image in the same category as the live preview image 106.For instance, if the filter recommendation module 304 determines thatthe user has selected the filter for smoothing the skin tone for most ofher selfie photos, the filter recommendation module 304 would select thefilter for smoothing the skin tone for images in the category of faceimages, such as a selfie image or other images containing a face.

The user's past behavior is established in a user profile 120 by theimage processing application 108 or other applications on the computingdevice 102. In some embodiments, the image processing application 108accesses, with the permission from the user, the saved images 118, suchas a photo gallery, on the computing device 102 to determine the filtersused for those saved images 118. For example, if the saved images 118have over a certain threshold of percentage of images containing foodwith more cool colors (such as in blue, green, gray tone), the imageprocessing application 108 adds, to the user profile 120, data statingthat the suggested filter for food images for this particular usershould include filters that generate cool colors. The image processingapplication 108 can also maintain a record of the selected filter by theuser in filtering images in the past. Further, as briefly discussedabove, the image processing application 108 can also build the userprofile 120 based on data related to the user that are stored on variousservers 130 accessible over the network 128, such as the user's socialmedia account, the user's online photo album, and so on.

In addition to user profile 120, the filter recommendation module 304can further select the recommended filter 316 based on contextualinformation, such as the geographic location of the computing device102. For example, a filter designed to add a text such as “Welcome tothe Golden Gate Bridge” is recommended if the image processingapplication 108 determines that the current location of the computingdevice 102 is near Golden Gate Bridge and the content of the image 106shows a bridge. Likewise, a filter for inserting a 3D object that isrelated to the location into the image can also be selected based on thedetected location of the computing device 102. In one implementation,the image processing application 108 determines the location of thecomputing device 102 using a GPS component of the computing device 102.Other mechanisms may also be utilized to determine the geographicallocation of the computing device 102, and thus the geographical locationwhere the live preview image 106 is captured.

In some embodiments, the contextual information used to select therecommended filter 316 also include the date of the live preview image106 being captured by the camera 104. The filter recommendation module304 utilizes the date to determine if there is any special eventassociated with the image so that filters designed for those events canbe recommended to the user. For example, a filter designed to addvirtual green and red holiday decorations to an image is recommended ifthe date of the image being captured is close to Christmas day, or afilter for adding bunnies and eggs is recommended to the user if thedate is close to Easter Day.

Likewise, the time when the live preview image 106 is captured by thecamera 104 can also be utilized to select the recommended filter 316.The filter recommendation module 304 uses the date information alongwith analyzing the content of the image to determine whether the livepreview image 106 is a nighttime image or a day time image. Depending onthe results, a filter for filtering night time image or a filter forfiltering day time image can be recommended.

In some implementations, additional algorithms that are specific to animage category are also utilized to determine the recommended filter andthe parameters of the recommended filter. For example, if a face objectis detected in the live preview image 106, the filter recommendationmodule 304 uses an algorithm to detect the mood of the face, such assad, happy, nonchalant, or bubbly. The detected mood can be utilized todetermine the recommended filter for face images. Further, a facetracking algorithm which analyzes the skin tone of the user by examiningthe percentage of colors in the detected face object can be utilized forproper face lighting using the recommended filter and filter parameters.Another example includes using a tracking algorithm to analyze thefacial features of the detected object to determine if a user is smilingor frowning, thereby determining the recommended filter and filterparameters.

For food images, an algorithm which analyzes the colors in the livepreview image 106 and determines if the food is warm (orange, brown, redcolors) or cold (blue, green, gray colors) may be utilized to determinethe recommended filer. For scenery images, the filter recommendationmodule 304 can utilize an algorithm to analyze the ambiance, such aswhether it is raining or sunny, or whether there are rainbows, todetermine the recommended filter and filter parameters. The filterrecommendation module 304 assigns different weights to combine thevarious factors to select the recommended filter 316. In addition, amachine learning model can be built and trained to determine therecommended filter based on the various factors and the detected objectin the live preview image 106. For instance, the machine learning modelhas multiple inputs corresponding to the factors described above and thedetected object or the category of images. The output of the machinelearning model includes an index of the recommended filter or a vectorcontaining multiple values each indicating the confidence ofrecommending a corresponding filter. The training of the machinelearning model is performed iteratively based on the training data sothat a loss function is minimized. The trained machine learning modelcan then be utilized to predict the recommended filter for a livepreview image based on the object detected and other factors or featuresassociated with the live preview image.

Referring back to FIG. 2, block 208 involves generating and presenting auser interface to indicate that context-aware image filtering isavailable for the live preview image 106. By detecting the object 314and determining the category of the live preview image 106, the imageprocessing application 108 may determine that context-aware imagefiltering is available for the live preview image 106. The imageprocessing application 108 generates and presents a user interface toinform the user that a context-aware image filtering mode is availableand can be enabled. In the example shown in FIG. 3, the image processingapplication 108 employs a user interface module 308 to generate andpresent the user interface 112 on the display device 110. In oneimplementation, the indication of the context-aware image filtering modecan be presented through a contextual user interface control 134, suchas an icon or a button. The contextual interface control is configuredto be actionable so that the user can press, click or otherwise selectthe contextual interface control, e.g. through a voice command, toconfirm to enable the context-aware image filtering mode. The contextualinterface control can also be presented along with other mechanisms ofnotification, such as by playing a sound or flashing an LED light.

At block 210, the process 200 involves receiving a user confirmation ofenabling the context-aware image filtering mode through the userinterface 112. At block 212, the process 200 involves enabling thecontext-aware image filtering mode and automatically applying therecommended filter to the live preview image 106 to generate thefiltered image 116. The filtered image 116 can be generated by an imagefiltering module 306 as shown in the example of FIG. 3 and be presentedin the user interface 112 through the user interface module 308.

In addition, the user interface module 308 is also configured to listthe recommended filter 316 and the list of applicable filters in theuser interface 112. The user thus can select another filter for the livepreview image 106 from the applicable filters to replace the recommendedfilter 316. The selected filter 318 is utilized by the image filteringmodule 306 to generate an updated filtered image 116 to display in theuser interface 112. In another example, the user interface module 308also presents user interface controls to allow the user to adjust theparameters of the selected filter 318 including the recommended filter316. The image filtering module 306 updates the filtered image 116 byapplying the selected filter 318 using the adjusted parameters set bythe user. The user can save the filtered image 116 if he or she issatisfied with the result. If, at some point, the detected object can nolonger be found in the current live preview image 106, the imageprocessing application 108 automatically exits the context-aware imagefiltering mode, and optionally, provides a notification to the user inthe user interface 112 to indicate that the image processing application108 has exited the context-aware image filtering mode. Additionalexamples of the user interface 112 and the operations related to theuser interface 112 are provided below with regard to FIGS. 5-9.

To generate the filtered image 116, in some implementations, the imagefiltering module 306 applies the recommended filter or the selectedfilter to the full resolution of live preview image 106, i.e. the livepreview image 106 that has not been down-sampled. The image filteringmodule 306 is also configured to implement object detection and objecttracking to track the detected object from one live preview image 106 toanother live preview image 106 as the camera 104 moves and new livepreview images 106 are available to the image processing application108. For example, face tracking can be implemented to track the faceobject detected in the live preview image 106 so that if the user movesthe camera 104, the detected face can still be located in the new livepreview image 106 for filtering. Likewise, other types of objects can betracked in a similar way so that the recommended filter or selectedfilter can be applied properly. To improve the tracking accuracy, in thecontext-aware image filtering mode, the image processing application 108is configured to process live preview images 106 more frequently thanthe pre-context-aware image filtering mode. In other words, the livepreview images 106 generated by the camera 104 are sampled morefrequently for processing such as processing an image for every 3 livepreview images 106 captured by the camera 104.

FIGS. 4A and 4B depict an example of a process 400 for utilizingcontext-aware image filtering to process live preview images 106 from acamera 104 of a computing device 102, according to certain embodimentsof the present disclosure. At block 402, the process 400 involvesreceiving a live preview image 106 from the camera 104. The imageprocessing application 108 receives the live preview image 106 in asimilar way as described with respect to block 202 of FIG. 2.

At block 404, the process 400 involves automatically detecting thesubject of the live preview image 106. As used herein, the “subject” ofthe image refers to content, topic, or keywords associated with theperson or thing shown in the live preview image 106. The subject of thelive preview image 106 can be detected by detecting one or more objectsin the live preview image 106, such as a face, car, human, building,food, tree, mountain, and so on. For example, the image processingapplication 108 can detect a live preview image 106 as a selfie image bydetecting a face in the image. In another example, the image processingapplication 108 detects that the subject of the live preview image 106includes a natural scene by detecting sky, lawn, tree, lakes, etc. Thesubject of the live preview image 106 might also be detected byanalyzing the color tone of the live preview image 106. For example, adark color tone might suggest that the live preview image 106 is anighttime image, and a light color tone might suggest a day time image.Likewise, a colorful image might suggest that the subject of the livepreview image 106 includes food. Further, blue, green, gray colorssuggest cold food whereas orange, brown, red colors suggest warm food.The detection of the subject of the image can be performed by utilizingan object detection algorithm, such as a face detection algorithm basedon the genetic algorithm and the eigen-face technique. Machine learningmodels can also be built and trained to recognize various objects orsubjects of an image and be utilized to detect the subject of the livepreview image 106.

If more than one object or subject are detected in the live previewimage 106, the image processing application 108 can utilize thetie-breaking mechanism described above with regard to block 204 in FIG.2 to determine the object or subject of the image. Also similar to block204, the image processing application 108 may detect the subject of thelive preview image 106 by using a down-sampled version of the livepreview image 106 to reduce the computational resource consumption.

At block 406, the process 400 involves determining a list of applicablefilters for the live preview image 106 from which a recommended filteris identified. This block involves similar operations like thoseinvolved in block 206 described with respect to FIG. 2. Similar to block206, in block 406, the list of applicable filters and the recommendedfilter can be determined based on the subject of the live preview image106. The image processing application 108 can determine a type orcategory of the live preview image 106 based on the subject of the livepreview image 106. The categories include, but are not limited to,selfie images, human images, food images, outdoor scene images,nighttime images, daytime images, and so on. A live preview image 106might be determined to belong to two or more image categories. In thatcase, the list of applicable filters can include filters that areapplicable to the images in these two or more categories. The applicablefilters also include the general image filters applicable to imagesregardless of the categories of the images.

The image processing application 108 determines the recommended filter316 in a similar way to that described with respect to block 206. Forexample, the image processing application 108 can determine therecommended filter 316 based on the category of the live preview image106. Other factors, such as the past behavior of the user, thepreference of the user, contextual information including the geographiclocation of the computing device 102, date and time when the livepreview image 106 is captured, can also be utilized to determine therecommended filter 316 and the filter parameters.

At block 408, the process 400 involves generating and presenting a userinterface indicating that the context-aware image filtering isavailable. Similar to the disclosure regarding block 208, the imageprocessing application 108 generates a contextual user interface control134 to indicate the availability of the context-aware image filteringmode. The contextual interface control is configured to be actionable sothat the user can press, click or otherwise select the contextual userinterface control 134 to confirm to enable the context-aware imagefiltering mode.

At block 410, the process 400 involves determining if the imageprocessing application 108 receives the confirmation of using thecontext-aware image filtering mode from the user. The confirmation canbe received by the user selecting or activating the contextual userinterface control 134. If the confirmation is not received, the process400 involves, at block 412, accessing an updated live preview image 106from the camera 104 to detect the subject of the image and determine therecommended filter as described above. As discussed above, at thisstage, the image processing application 108 may be configured to accessand process the live preview image 106 at a reduced rate to reduce thecomputational resource consumption of the context-aware image filtering.For instance, instead of processing every live preview image 106captured by the camera 104, the image processing application 108accesses and processes a live preview image for every N images capturedby the camera 104. In one example, N takes the value of 10.

If it is determined at block 410 that the user has confirmed to use thecontext-aware image filtering mode, the process 400 involves, at block414, automatically applying the recommended filter to the live previewimage 106 to generate the filtered image 116. At block 416, the process400 involves displaying the filtered image 116 in the display device110. In addition, the image processing application 108 may also presentthe recommended filter, the applicable filters, and the availablefilters in the user interface so that the user can select a filterdifferent from the recommended filter to be applied to the live previewimage 106. In a further example, the user interface is also configuredto present user interface controls to allow the user to adjust theparameters of a selected filter including the recommended filter 316. Inresponse to the parameter adjustment by the user, the image processingapplication 108 updates the filtered image 116 by applying the selectedfilter using the adjusted parameters.

At block 418, the process 400 involves determining if a user input isreceived from the user interface. If no user input is received, theprocess involves accessing an updated live preview image 106 at block420 and processing the updated live preview image 106 at block 422.Processing the updated live preview image 106 includes performing objecttracking in the updated live preview image 106 if an object is detectedin the previous live preview image 106. The object tracking allows thedetected object to be identified in the updated live preview image 106so that the recommended filter can be properly applied. In someimplementations, accessing the updated live preview image 106 involvedat block 420 is performed at a higher rate than block 412. In otherwords, the live preview images 106 captured by the camera 104 aresampled more frequently at block 420 than block 412 in order to ensurethe performance of the object tracking and the filtering operation. As aresult of the higher sampling rate, the filtered images 116 displayed inthe user interface 112 have a higher visual quality and provide asmoother preview of the filtered image 116 to the user.

If, at block 418, it is determined that a user input is received, theprocess 400 involves different operations depending on the user input.If the user input specifies a new filter, the process 400 involvesapplying the specified new filter on the live preview image 106 at block428. For example, the user can select a filter from the applicablefilters or available filters from the user interface. In response tosuch a selection, the image processing application 108 applies theselected filter to the live preview image 106 to generate an updatedfiltered image to present in the user interface. If the user inputincludes parameter adjustment of the currently selected filter, theprocess 400 involves, at block 430, applying the existing filter withthe newly adjusted parameters to the live preview image 106. Forexample, the user can change the filter length or the window size of askin tone smoothing filter by operating on a user interface control,such as a slider, in the user interface. The image processingapplication 108 updates the filtered image 116 by applying the filterwith the updated parameter to the live preview image 106. The filteredimage generated in block 428 or block 430 is continuously updatedthrough operations in blocks 420 and 422 as the user moves the camera104. Specifically, the image processing application 108 keeps accessingupdated live preview image 106 from the camera 104 and applies theselected filter with the selected parameter to generate an updatedfiltered image 116 for display in the user interface.

If the user input includes instructions to save the filtered image, theprocess 400 involves, at block 424, saving the filtered image 116 to astorage device of the computing device 102. If the user input includesinstructions to cancel the operations, the process 400 involves exitingthe context-aware image filtering mode and returning the computingdevice 102 to the initial stage where the no context-aware imagefiltering is applied. At that point, the image processing application108 may access a new live preview image 106 from the camera 104 to startthe process described above again.

FIGS. 5-8 depict examples of user interfaces 500-800 for context-awareimage filtering, according to certain embodiments of the presentdisclosure. The user interface 500 depicts an example of the userinterface 500 in the pre-context-aware image filtering mode when thecontext-aware image filtering is not available. In this example, thecamera 104 was pointing at a scene where a lady was standing in front ofa house. The live preview image 502 depicting that scene is shown in theuser interface 500. This live preview image 502 shows a portion of thelady's face which is not sufficient to detect a face object. Other partsof the image 502, such as the ground, the tree, the car are also notlarge enough to enable the detection of an object or the determinationof the subject of the image 502. As such, the image processingapplication 108 could not determine the subject of the image 502 and thecamera 104 functions as normal. The user interface 500 further includesa save button 506 that the user can select to save the live previewimage 502 to a storage device of the computing device 102. The userinterface 500 further includes a filter icon that the user can select tomanually choose a filter to apply to the currently displayed image 502.

The user interface 600 shown in FIG. 6 depicts an example of the userinterface provided in the context-aware image filtering mode. In thisexample, the live preview image 602 shows the complete face of the lady,and thus the image processing application 108 is able to detect the faceobject and determines that the image 602 is in the category of faceimages. Based on the detected face object, the image processingapplication 108 is able to determine a recommended filter for thecontext-aware image filtering. As such, in this example, the imageprocessing application 108 generates and presents a contextual userinterface control 604 to indicate that the context-aware image filteringis available for this image. The user can thus select the contextualuser interface control 604 to enter the context-aware image filteringmode to use the recommended filter.

The user interface 700 shown in FIG. 7 depicts an example of the userinterface where the image processing application 108 enters thecontext-aware image filtering mode. In this example, the user interface700 includes an indication 704 that a face is detected in the currentlive preview image. Further, the recommended filter, the “portrait”filter in this example, is automatically applied to the live previewimage to generate a filtered image 702. In this example, the recommendedfilter is configured to smooth the skin tone of the detected face objectand thus the freckles on the lady's face have been removed as shown inthe filtered image 702.

The user interface 700 further includes a filter panel 706 to show alist of filters including the recommended filter, the applicablefilters, and the available filters. In the example shown in userinterface 700, each of the filters is indicated with a circle 708 alongwith text to show the name of the filter. The applicable filters areeach marked with a badge 710 to distinguish them from the rest of theavailable filters. The recommended filter 712 is listed as the firstfilter in the filter panel 706. Further, the filter that is currentlyapplied to the image 702 is presented differently from other filters,such as being shaded as shown in the example of user interface 700. Theuser interface 700 also includes a user interface control 714 which,when selected by the user, will cause the image processing application108 to exit the context-aware image filtering mode and thus to disablethe filter that has been applied to the live preview image.

The user interface 800 shown in FIG. 8 depicts an example of the userinterface where the user selects a different filter than the recommendedfilter. In this example, the filter “Pop Art” is selected by the userand thus the filtered image 804 shown in the user interface 800 isfiltered using the selected filter rather than the recommended filter“Portrait.” The effect of this filter is illustrated by the dotted shadeappearing in the sky area of the image 802. In any of the userinterfaces 500-800, the user can select the user interface control 506to save the image that is currently displayed in the user interface to astorage device of the computing device 102.

FIG. 9 depicts an example of a user interface 900 for adjusting theparameters of the selected filter, according to certain embodiments ofthe present disclosure. In the user interface 900, a slider 904 ispresented which can be used to adjust the parameter value of thecurrently selected filter, including the recommended filter that isautomatically selected by the image processing application 108. Forexample, slider 904 can represent the smoothing window size of theportrait filter that is configured to smooth the skin tone. The user canincrease the value of the slider 904 to increase the size of thesmoothing window of the portrait filter so that the skin tone is furthersmoothed, or decrease the value of the slider 904 to decrease the sizeof the smoothing window to have the skin tone less smoothed. Similar ordifferent user interface controls can be presented to control variousparameters of the selected filter. The user interface controls foradjusting the filter parameters can be invoked by the user activating auser interface control in the user interface 700 or 800, or beautomatically displayed responsive to the image processing application108 entering the context-aware image filtering mode or responsive to adifferent filter being selected by the user.

For illustrative purposes, the above examples describe that the list ofapplicable filters and the recommended filter are determined when theobject or subject of the live preview image is determined. However, inother embodiments, these filters can also be determined at any othertime, such as when the system is in the context-aware image filteringmode, i.e. the confirmation of using the context-aware image filteringmode is received from the user, e.g. by the user selecting thecontextual user interface control.

While the above description focuses on applying the context-aware imagefiltering to live preview images from a camera, the context-aware imagefiltering can also be applied to saved images. For example, instead ofaccessing a live preview image 106 from the camera 104, the imageprocessing application 108 may access a saved image 118 on the computingdevice 102 or a saved image on a remote server 130 that is accessiblevia the network 128. Similar to the process described above with respectto live preview images, the image processing application 108 may analyzethe saved image to determine the subject of the image, such as bydetecting an object in the image. Based on the subject of the image, theimage processing application 108 classifies the image into an imagecategory. A set of applicable filters can be determined for the imagebased on the image category. A recommended filter can be selected fromthe applicable filters and automatically applied to the saved image ifthe user confirms the use of the context-aware image filtering mode. Theuser interface 112 generated for the live preview images can besimilarly generated and presented as described above except that thestatic saved image is displayed instead of the dynamic live previewimage. This process can be repeated for each of the saved images toimprove the perceptual quality of the existing saved images.

Computing System Example for Context-Aware Image Filtering

Any suitable computing system can be used for performing the operationsdescribed herein. For example, FIG. 10 depicts an example of a computingdevice 1000 that can implement the computing device 102 of FIG. 1. Insome embodiments, the computing device 1000 can include a processor 1012that is communicatively coupled to a memory 1014 and that executescomputer-executable program code and/or accesses information stored inthe memory 1014. The processor 1012 may comprise a microprocessor, anapplication-specific integrated circuit (“ASIC”), a state machine, orother processing device. The processor 1012 can include any of a numberof processing devices, including one. Such a processor can include ormay be in communication with a computer-readable medium storinginstructions that, when executed by the processor 1012, cause theprocessor to perform the operations described herein.

The memory 1014 can include any suitable non-transitorycomputer-readable medium. The computer-readable medium can include anyelectronic, optical, magnetic, or other storage device capable ofproviding a processor with computer-readable instructions or otherprogram code. Non-limiting examples of a computer-readable mediuminclude a magnetic disk, memory chip, ROM, RAM, an ASIC, a configuredprocessor, optical storage, magnetic tape or other magnetic storage, orany other medium from which a computer processor can read instructions.The instructions may include processor-specific instructions generatedby a compiler and/or an interpreter from code written in any suitablecomputer-programming language, including, for example, C, C++, C#,Visual Basic, Java, Python, Perl, JavaScript, and ActionScript.

The computing device 1000 can also include a bus 1016. The bus 1016 cancommunicatively couple one or more components of the computing device1000. The computing device 1000 can also include a number of external orinternal devices such as input or output devices. For example, thecomputing device 1000 is shown with an input/output (“I/O”) interface1018 that can receive input from one or more input devices 1020 orprovide output to one or more output devices 1022. The one or more inputdevices 1020 and one or more output devices 1022 can be communicativelycoupled to the I/O interface 1018. The communicative coupling can beimplemented via any suitable manner (e.g., a connection via a printedcircuit board, connection via a cable, communication via wirelesstransmissions, etc.). Non-limiting examples of input devices 1020include a touch screen (e.g., one or more cameras for imaging a toucharea or pressure sensors for detecting pressure changes caused by atouch), a mouse, a keyboard, or any other device that can be used togenerate input events in response to physical actions by a user of acomputing device. Non-limiting examples of output devices 1022 includean LCD screen, an external monitor, a speaker, or any other device thatcan be used to display or otherwise present outputs generated by acomputing device.

The computing device 1000 can execute program code that configures theprocessor 1012 to perform one or more of the operations described abovewith respect to FIGS. 1-9. The program code can include the imageprocessing application 108. The program code may be resident in thememory 1014 or any suitable computer-readable medium and may be executedby the processor 1012 or any other suitable processor.

The computing device 1000 can also include at least one networkinterface device 1024. The network interface device 1024 can include anydevice or group of devices suitable for establishing a wired or wirelessdata connection to one or more data networks 128. Non-limiting examplesof the network interface device 1024 include an Ethernet networkadapter, a modem, and/or the like. The computing device 1000 cantransmit messages as electronic or optical signals via the networkinterface device 1024.

The computing device 1000 can also include one or more image capturingdevice(s) 1030, such as a camera 104 or other imaging device that iscapable of capturing a photographic or video image. The image capturingdevice(s) 1030 can be configured to capture still images and/or video.The image capturing device(s) 1030 may utilize a charge coupled device(“CCD”) or a complementary metal oxide semiconductor (“CMOS”) imagesensor to capture images. In some configurations, the image capturingdevice(s) 1030 include a flash to aid in taking pictures in low-lightenvironments. Settings for the image capturing device(s) 1030 may beimplemented as hardware or software buttons.

General Considerations

Numerous specific details are set forth herein to provide a thoroughunderstanding of the claimed subject matter. However, those skilled inthe art will understand that the claimed subject matter may be practicedwithout these specific details. In other instances, methods,apparatuses, or systems that would be known by one of ordinary skillhave not been described in detail so as not to obscure claimed subjectmatter.

Unless specifically stated otherwise, it is appreciated that throughoutthis specification discussions utilizing terms such as “processing,”“computing,” “calculating,” “determining,” and “identifying” or the likerefer to actions or processes of a computing device, such as one or morecomputers or a similar electronic computing device or devices, thatmanipulate or transform data represented as physical electronic ormagnetic quantities within memories, registers, or other informationstorage devices, transmission devices, or display devices of thecomputing platform.

The system or systems discussed herein are not limited to any particularhardware architecture or configuration. A computing device can includeany suitable arrangement of components that provide a result conditionedon one or more inputs. Suitable computing devices include multi-purposemicroprocessor-based computer systems accessing stored software thatprograms or configures the computing system from a general purposecomputing apparatus to a specialized computing apparatus implementingone or more embodiments of the present subject matter. Any suitableprogramming, scripting, or other type of language or combinations oflanguages may be used to implement the teachings contained herein insoftware to be used in programming or configuring a computing device.

Embodiments of the methods disclosed herein may be performed in theoperation of such computing devices. The order of the blocks presentedin the examples above can be varied—for example, blocks can bere-ordered, combined, and/or broken into sub-blocks. Certain blocks orprocesses can be performed in parallel.

The use of “adapted to” or “configured to” herein is meant as an openand inclusive language that does not foreclose devices adapted to orconfigured to perform additional tasks or steps. Additionally, the useof “based on” is meant to be open and inclusive, in that, a process,step, calculation, or other action “based on” one or more recitedconditions or values may, in practice, be based on additional conditionsor values beyond those recited. Headings, lists, and numbering includedherein are for ease of explanation only and are not meant to belimiting.

While the present subject matter has been described in detail withrespect to specific embodiments thereof, it will be appreciated thatthose skilled in the art, upon attaining an understanding of theforegoing, may readily produce alterations to, variations of, andequivalents to such embodiments. Accordingly, it should be understoodthat the present disclosure has been presented for purposes of examplerather than limitation, and does not preclude the inclusion of suchmodifications, variations, and/or additions to the present subjectmatter as would be readily apparent to one of ordinary skill in the art.

1. A non-transitory computer-readable medium having program code that isstored thereon, the program code executable by a processing device forperforming operations comprising: detecting an object in an image thatis in a field of view of a camera associated with the processing device;determining, based on the object detected in the image, a recommendedfilter for the image from a list of filters available for filtering theimage; causing a display device to display, prior to presenting therecommended filter, a user interface comprising a contextual userinterface control, the contextual user interface control indicating thata context-aware image filtering mode is available; and enabling,responsive to receiving a selection of the contextual user interfacecontrol, the context-aware image filtering mode by automaticallyapplying the recommended filter to the image to generate a filteredimage and causing the display device to display the filtered image. 2.The non-transitory computer-readable medium of claim 1, wherein theoperations further comprise: determining, from the list of filters, aplurality of filters that are applicable to the image based on theobject detected in the image, the plurality of filters comprising therecommended filter; causing the plurality of filters to be presented inthe user interface along with the recommended filter; receiving aselection of a second filter from the plurality of filters that isdifferent from the recommended filter; and in response to receiving theselection of the second filter, filtering the image using the secondfilter to generate a second filtered image and causing the displaydevice to display the second filtered image.
 3. The non-transitorycomputer-readable medium of claim 2, wherein the operations furthercomprise determining a category of the image based on the detectedobject, wherein the plurality of filters are determined based on thecategory of the image.
 4. The non-transitory computer-readable medium ofclaim 2, wherein the plurality of filters comprise a 3D filterconfigured for inserting a 3D object into an input image to generate acombined image.
 5. The non-transitory computer-readable medium of claim1, wherein the recommended filter is determined based on a user profileassociated with a user of the processing device, the user profilespecifying a history of filters selected by the user when filteringimages.
 6. The non-transitory computer-readable medium of claim 5,wherein the recommended filter is further determined based on one ormore of a geographic location of the camera, a current date, or acurrent time.
 7. The non-transitory computer-readable medium of claim 1,wherein the operations further comprise: receiving an updated image thatis currently in the field of view of the camera; generating an updatedfiltered image by applying the recommended filter to the updated image;updating the filtered image displayed on the display device with theupdated filtered image; and saving, responsive to a user input requestthat the filtered image be saved, the filtered image to a storagedevice.
 8. The non-transitory computer-readable medium of claim 1,wherein detecting the object in the image comprises detecting a face inthe image, and wherein detecting the face comprises: down-sampling theimage to generate a low-resolution version of the image; and applying aface detection technique on the low-resolution version of the image todetect the face.
 9. The non-transitory computer-readable medium of claim8, wherein the operations further comprise: in response to receiving theselection of the contextual user interface control, applying the facedetection technique to the image that is currently in the field of viewof the camera to detect the face; and applying a face tracking techniqueto track the face in the image so that the recommended filter can beapplied to the detected face.
 10. An apparatus comprising: a cameraconfigured for capturing an image that is in a field of view of thecamera; a display device coupled to the camera and configured fordisplaying the image; a processing device coupled to the camera and thedisplay device; and a non-transitory computer-readable mediumcommunicatively coupled to the processing device, wherein the processingdevice is configured to execute program code stored in thenon-transitory computer-readable medium and thereby perform operationscomprising: detecting a subject in the image that is currently in thefield of view of the camera; determining, based on the subject detectedin the image, a recommended filter for the image from a list of filtersavailable for filtering the image; causing the display device todisplay, prior to presenting the recommended filter, a user interfacecomprising a contextual user interface control, the contextual userinterface control indicating that a context-aware image filtering modeis available; and enabling, responsive to receiving a selection of thecontextual user interface control, the context-aware image filteringmode by automatically applying the recommended filter to the image togenerate a filtered image and causing the display device to display thefiltered image.
 11. The apparatus of claim 10, wherein the operationsfurther comprise: determining, from the list of filters, a plurality offilters that are applicable to the image based on the subject detectedin the image, the plurality of filters comprising the recommendedfilter; causing the plurality of filters to be presented in the userinterface along with the recommended filter; receiving a selection of asecond filter from the plurality of filters that is different from therecommended filter; and in response to receiving the selection of thesecond filter, filtering the image using the second filter to generate asecond filter image and causing the display device to display the secondfiltered image.
 12. The apparatus of claim 10, wherein the operationsfurther comprise: causing the display device to display a second userinterface control in the user interface, the second user interfacecontrol configured for adjusting a parameter of the recommended filter;reapplying, responsive to receiving a selection of the second userinterface control, the recommended filter to the image to generate anupdated filtered image by changing the parameter of the recommendedfilter to a value specified by the selection of the second userinterface control; and causing the display device to display the updatedfiltered image.
 13. The apparatus of claim 10, wherein detecting thesubject in the image comprises detecting a human face in the image, andwherein detecting the human face comprises: down-sampling the image togenerate a low-resolution version of the image; and applying a facedetection technique on the low-resolution version of the image to detectthe human face in the image.
 14. The apparatus of claim 13, wherein theoperations further comprise: in response to receiving the selection ofthe contextual user interface control, applying the face detectiontechnique to the image that is currently in the field of view of thecamera to detect the human face; and applying a face tracking techniqueto track the human face in the image so that the recommended filter canbe applied to the detected human face.
 15. The apparatus of claim 10,wherein detecting the subject in the image comprises detecting food inthe image, and wherein the recommended filter is determined based on acolor of the detected food.
 16. The apparatus of claim 10, wheredetecting the subject in the image comprises: detecting a plurality ofobjects in the image; determining a size of each of the plurality ofobjects in the image; comparing the size of each of the plurality ofobjects with a respective threshold value; and determining the subjectof the image based on an object whose size being higher than therespective threshold value.
 17. A computer-implemented method in which aprocessing device performs operations comprising: obtaining a livepreview image that is currently in a field of view of a cameraassociated with the processing device; determining, based on a subjectdetected in the live preview image, a recommended filter for the livepreview image; causing a display device to display, prior to presentingthe recommended filter, a user interface comprising a contextual userinterface control, the contextual user interface control indicating thata context-aware image filtering mode is available; enabling, responsiveto receiving a selection of the contextual user interface control, thecontext-aware image filtering mode by automatically applying therecommended filter to the live preview image to generate a filteredimage; and causing a display device to present the filtered image. 18.The computer-implemented method of claim 17, the operations furthercomprising: receiving an updated live image that is currently in thefield of view of the camera; generating an updated filtered image byapplying the recommended filter to the updated live image; and updatingthe filtered image displayed on the display device with the updatedfiltered image.
 19. The computer-implemented method of claim 17, whereinthe operations further comprise: determining a plurality of filters thatare applicable to the live preview image, the plurality of filterscomprising the recommended filter; causing the plurality of filters tobe presented in the user interface along with the recommended filter;receiving a selection of a second filter that is different from therecommended filter from the plurality of filters; and in response toreceiving the selection of the second filter, filtering the live previewimage using the second filter to generate a second filter image andcausing the display device to display the second filtered image.
 20. Thecomputer-implemented method of claim 19, wherein the operations furthercomprise determining a category of the live preview image, wherein theplurality of filters are determined based on the category of the livepreview image.